<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AceCRC: /home/brian/src/AceCRC/src/ace_crc/crc16ccitt_nibblem.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AceCRC
   &#160;<span id="projectnumber">1.1.1</span>
   </div>
   <div id="projectbrief">Cyclic Redundancy Check (CRC) algorithms (e.g. crc16ccitt, crc32) programmatically converted from C99 code generated by pycrc (https://pycrc.org) to Arduino C++ using namespaces and PROGMEM flash memory.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_7e2fca1243a23cea849d389c30292e19.html">ace_crc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">crc16ccitt_nibblem.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="crc16ccitt__nibblem_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#ifndef ACE_CRC_CRC16CCITT_NIBBLEM_HPP</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#define ACE_CRC_CRC16CCITT_NIBBLEM_HPP</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">namespace </span>ace_crc {</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keyword">namespace </span>crc16ccitt_nibblem {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="crc16ccitt__nibblem_8hpp.html#a616a76c060b80d1a899590857f0efbd7">   60</a></span>&#160;<span class="keyword">const</span> uint8_t CRC_ALGO_TABLE_DRIVEN = 1;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">   68</a></span>&#160;<span class="keyword">typedef</span> uint16_t <a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="crc16ccitt__nibblem_8hpp.html#a633fb8b06c6d35a575d686ad531690f5">   76</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a> crc_init(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;{</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">return</span> 0x1d0f;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;}</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;crc_t crc_update(crc_t crc, <span class="keyword">const</span> <span class="keywordtype">void</span> *data, <span class="keywordtype">size_t</span> data_len);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="crc16ccitt__nibblem_8hpp.html#ad1758fc8c94f7955376b7b97b69f6450">   99</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a> crc_finalize(<a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a> crc)</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;{</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">return</span> crc;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="crc16ccitt__nibblem_8hpp.html#adefa1f58649e9dfed3761ea0d1864bd4">  112</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a> crc_calculate(<span class="keyword">const</span> <span class="keywordtype">void</span> *data, <span class="keywordtype">size_t</span> data_len) {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  <a class="code" href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">crc_t</a> crc = crc_init();</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  crc = crc_update(crc, data, data_len);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  <span class="keywordflow">return</span> crc_finalize(crc);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;}</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;} <span class="comment">// crc16ccitt_nibblem</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;} <span class="comment">// ace_crc</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="preprocessor">#endif      </span><span class="comment">/* ACE_CRC_CRC16CCITT_NIBBLEM_HPP */</span><span class="preprocessor"></span></div>
<div class="ttc" id="acrc16ccitt__nibblem_8hpp_html_a1173173a65d170566bfac2bd92943f55"><div class="ttname"><a href="crc16ccitt__nibblem_8hpp.html#a1173173a65d170566bfac2bd92943f55">ace_crc::crc16ccitt_nibblem::crc_t</a></div><div class="ttdeci">uint16_t crc_t</div><div class="ttdoc">The type of the CRC values.</div><div class="ttdef"><b>Definition:</b> <a href="crc16ccitt__nibblem_8hpp_source.html#l00068">crc16ccitt_nibblem.hpp:68</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
